package com.example.concurrency.thread02_strategy;

/**
 * @description: 旅行者
 * @program: demos
 * @author: dove
 * @date: 2020-12-03 23:15
 **/

public class Traveler {
    // 维护 策略 接口对象 的一个引用
    private TravelStrategy travelStrategy;

    public void setTravelStrategy(TravelStrategy travelStrategy) {
        this.travelStrategy = travelStrategy;
    }

    // 调用对应策略的实现
    public void travelMethod(){
        travelStrategy.travelAlgorithm();
    }

}
